﻿import http from '@/utils/http';
import type { Ilogin, IchangePWd, IUserId } from '@/types/baseMoudle';

const mode = import.meta.env.VITE_MODE_ENV;

export default {
    // 配置文件
    getConifg: () =>
        http({ url: mode == 'dev' ? '/config/api/config' : '/api/config', method: 'get', loading: false, other: true }),
    // 密码登录
    login: (data: Ilogin) => http({ url: '/api/login/login', loading: false, data }),
    // 修改密码
    setpassword: (data: IchangePWd) => http({ url: '/api/login/setpassword', loading: false, data }),
    // 获取二维码
    generatingverifyqrcode: (data: Ilogin) => http({ url: '/api/login/generatingverifyqrcode', loading: false, data }),
    // fta认证登录
    authbytfa: (data: Ilogin) => http({ url: '/api/login/authbytfa', loading: false, data }),
    // 退出
    loginout: (data: any) => http({ url: '/api/account/loginout', data, loading: false }),
    // 重置FTP
    resettfa: (data: IUserId) => http({ url: `/api/account/resettfa`, data, loading: false }),
};
